package com.dnjn.happiness.biz.api;

import com.dnjn.happiness.biz.api.factory.RemoteAppraiseFallbackFactory;
import com.dnjn.happiness.biz.api.model.AppraiseModel;
import com.dnjn.happiness.common.core.constant.SecurityConstants;
import com.dnjn.happiness.common.core.constant.ServiceNameConstants;
import com.dnjn.happiness.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "remoteAppraiseService", value = ServiceNameConstants.BIZ_SERVICE, fallbackFactory = RemoteAppraiseFallbackFactory.class)
public interface RemoteAppraiseService {

    @GetMapping("/getAppraiseRecords/{userId}/{time}")
    R<List<AppraiseModel>> getAppraiseRecords(@PathVariable("userId") Long userId, @PathVariable("time") String time, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/admin/appraise/getHappinessScoresViewAppriseNew/{userId}/{base_percent}/{x}")
    public R<Double> getHappinessScoresViewAppriseNew(@PathVariable("userId") Long userId, @PathVariable("base_percent") Double base_percent, @PathVariable("x") Double x, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
